home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 25 / 025.d81 / rotate sprites (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  2KB  |  65 lines

  1. 10 fori=53289to53293:pokei,0:next
  2. 20 poke53269,0:print"[147]  this program takes data for 1 sprite" chr$(142)
  3. 30 print"        and calculates new data"
  4. 40 print" to put sprite in different positions.":print
  5. 50 print"         to use on your data"
  6. 52 print"   replace data at end of program"
  7. 60 print"         with your own data":print
  8. 70 print"        hit a key to continue"
  9. 72 print:print"    the sprite will appear at the"
  10. 74 print"       top-left of the screen."
  11. 80 poke198,0:wait198,1:getk$
  12. 90 by=21:dim b(21,3),f(21,21),u(21,3),  a(24,24) ,ro(24,3),sp(75),sp$(75)
  13. 100 v=53248:j=0:pokev+28,0:pokev+29,0:pokev+23,0
  14. 102 fori=1toby:fork=1to3
  15. 110 read b(i,k):sp(j)=b(i,k):j=j+1:next :next :gosub430
  16. 120 print"[147]1[146] to flip right to left"
  17. 130 print"2[146] to flip up to down   "
  18. 140 print"    to rotate 90 degrees "
  19. 150 print"3[146] spread data evenly over row & columns"
  20. 160 print"4[146] strip data from right of sprite"
  21. 162 print"5[146] return to loadstar"
  22. 170 if sb>4 then print"[147]out of sprites...":fordl=1to1000:next:run90
  23. 180 poke198,0:wait198,1:getk$
  24. 190 ifk$<"1"ork$>"5"then180
  25. 192 ifk$="5"then60000
  26. 200 print"[147]":b=val(k$):ti$="000000":onbgoto210,270,300,300
  27. 210 for i=1toby:fork=1to3 : s=b(i,k)
  28. 220 forp=7 to 0 step -1:print""ti$
  29. 230 if 2^p=<s then f(i,4-k)=f(i,4-k)+2^(7-p): s=s-2^p
  30. 240 next :next:next
  31. 250 j=0: for i=1toby:fork=1to3:sp(j)=f(i,k):j=j+1:next:next
  32. 260 gosub430:goto120
  33. 270 j=0: for i=1toby:print""ti$:  for k=1to3
  34. 280 u(i,k)=b(by+1-i,k):sp(j)=u(i,k)
  35. 290 j=j+1:next :next:gosub430: goto120
  36. 300 q=by: for i=byto1step-1:print""ti$:fork=1to3:s=b(i,k)
  37. 310 forp=7to0step-1:  a((k-1)*8+8-p,by+1-q)=0
  38. 320 if2^p<=sthena((k-1)*8+8-p,by+1-q)=1:s=s-2^p
  39. 330 nextp: next k :ifb=4then360
  40. 340 ifi/7<>int(i/7)then360
  41. 350 q=q-1:fort=1to24:a(t,by+1-q)=a(t,by-q):next t
  42. 360 q=q-1: next i
  43. 370 j=0:q=1:  for r=1to21
  44. 380 if b=3and r/7=int(r/7)then q=q+1
  45. 390 forc=1to3:ro(r,c)=0:for p=7to0 step-1
  46. 400 if a(q,(c-1)*8+8-p)=1then ro(r,c)=ro(r,c)+2^p
  47. 410 next p:sp(j)=ro(r,c):j=j+1
  48. 420 nextc:q=q+1:nextr: gosub430:goto120
  49. 430 print"[147]":  sb=sb+1:pw=pw+2^(sb):pokev+21,pw:poke2040+sb,220+sb:pokev+39+sb,1
  50. 440 for n=0to 62:poke14080+64*sb+n,sp(n):next
  51. 450 print"[147]":pokev+(sb*2),40*sb:pokev+(sb*2+1),50
  52. 460 print"press 'y' to see data"
  53. 470 poke198,0:wait198,1:getk$
  54. 480 if k$<>"y"then530
  55. 490 for n=0to62step9 :form=0to8 :sp$(n+m)=str$(sp(n+m))
  56. 500 printtab(4*m);sp$(n+m);:next:print: next
  57. 510 print:print"hit any key to continue"
  58. 520 get k$:ifk$=""then520
  59. 530 print"[147]":  return
  60. 540 data 0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,60,0,0,126,0,0
  61. 550 data 239,0,0,135,255,224,7,255,240,3,255,252,3,255,247,1,254,227
  62. 560 data 1,249,230,1,225,96,1,34,96,1,36,224 ,1,242,128,0,8,128,0,0,0,0,0,0
  63. 60000 rem connect to ls
  64. 60010 print"[147]reconnecting...":poke53248+21,0:load"hello connect",8
  65.